﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="WarrantyService.aspx.cs" Inherits="VSM.WarrantyService" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function openMultiItemDialog() {
            var tabid = '<%= Request.QueryString["requestType"] %> ';
            javascript: Main.openCustomDialog('../../ItemPopup.aspx?ItemCategory=' + '102', 600, 610, "");
        }

        function openCustomer() {
            var url = "Popup_Customer.aspx?CustomerCode=S";
            Main.openCustomDialog(url, 650, 410);
        }

        function openVehicle() {
            var url = "Popup_Vehice.aspx?VehicleCode=S";
            Main.openCustomDialog(url, 650, 410);
        }

        function disablePopup(sender, evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (charCode == 13)
                return true;

            return true;
        }

        function loadQuotationReport() {
            var url = "rptQuotation.aspx?QuotationCode=S";
            Main.openCustomDialog(url, 650, 410);
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="DealerCode" runat="server" />
                <h2>
                    Warranty Service Claim</h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                   

                      <table border="0" width="100%" style="background-color: #D1D4D8;">
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            VIN:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="txtVINCode" runat="server" Width="70%"></asp:TextBox>
                                            <asp:Button ID="Button1" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF" Height="22px"
                                                Text="Go" Width="18%" />
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 10%">
                                            Failure Date:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="txtFailureDate" runat="server" Width="90%"></asp:TextBox>
                                            <asp:ImageButton ID="ImageButton1" runat="Server" AlternateText="Click to show calendar"
                                                ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                            <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFailureDate"
                                                PopupButtonID="ImageButton1" Format="dd/MM/yyyy">
                                            </cc1:CalendarExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Vehicle ID:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox1" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 15%">
                                            Odometer:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox15" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Reg. No:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox2" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 15%">
                                            Customer Name:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox7" runat="server" Width="70%"></asp:TextBox>
                                            <asp:Button ID="btn_SelectCustomer" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                                Height="22px" Text="..." Width="18%" OnClientClick="openCustomer();" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Chassis No:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox3" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 15%">
                                            Other Name:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox8" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Engine No:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox4" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Address:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox9" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Model:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox5" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 15%">
                                            Tel:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox10" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Sold Date:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox6" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 15%">
                                            Tax Code:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox11" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Exp Warranty Date:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox16" runat="server" Width="90%"></asp:TextBox>
                                            <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtFailureDate"
                                                PopupButtonID="ImageButton1" Format="dd/MM/yyyy">
                                            </cc1:CalendarExtender>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 14%">
                                            Contact Person:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox12" runat="server" Width="90%"></asp:TextBox>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td class="FormLineItemAlt" style="width: 15%">
                                            Remarks:
                                        </td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            <asp:TextBox ID="TextBox19" runat="server" Height="72px" TextMode="MultiLine" 
                                                Width="90%"></asp:TextBox>
                                        </td>
                                         <td class="FormLineItemAlt" style="width: 15%">
                                             &nbsp;</td>
                                        <td class="FormLineItemAlt" style="width: 35%">
                                            &nbsp;</td>
                                    </tr>
                                </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr style="background: url(../../Images/tabbar.png); height: 30px">
                            <td colspan="4">
                                <asp:Label ID="Label3" runat="server" Text=" Parts" Font-Bold="True" ForeColor="White"></asp:Label>
                            </td>
                        </tr>
                    </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr>
                            <td>
                                <asp:Button ID="btn_AddPart" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                    Height="30px" Text="Add Part" Width="130px" OnClick="btn_Addpart_Click" />
                            </td>
                        </tr>
                    </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                    <asp:GridView ID="grvPO" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px"  CellSpacing="2" 
                            HeaderStyle-VerticalAlign="Middle" 
                            AllowPaging="True" >
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                            <Columns>
                                <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="70px" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" TabIndex="-1" OnClick="lnkDelete_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblNo" runat="server" Text="" BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Part NBR">
                                    <ItemStyle HorizontalAlign="Left" Width="100px" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="lblItemCode" runat="server" Text='<%# Bind("ItemCode") %>' OnTextChanged='TextBox_Change'
                                            OnKeyPress="return disablePopup(this, event);"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Part Name">
                                    <ItemStyle HorizontalAlign="Center" Width="250px" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblItemName" runat="server" Text='<%# Bind("ItemName") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="VN Name">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" Width="80px" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbFrgnName" runat="server" Text='<%# Bind("FrgnName") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Quantity">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" Width="100px" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtQty" runat="server" Width="97%" Text='<%# Bind("Quantity") %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" Style="text-align: right"
                                            OnTextChanged="txtOrderQuantity_OnTextChanged" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Price">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbPrice" runat="server" Text='<%# Bind("Price") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="VAT">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbVat" runat="server" Text='<%# Bind("VAT") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Discount">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtDiscount" Style="text-align: right" runat="server" Text='<%# Bind("DiscPrcnt") %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" OnTextChanged="txtUnitPrice_OnTextChanged" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="P. Stock">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <HeaderStyle VerticalAlign="Middle" Width="80px" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbStock" runat="server" Text='<%# Bind("Stock") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                                Height="27px" VerticalAlign="Bottom" />
                            <EmptyDataTemplate>
                                <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                    cellspacing="2" cellpadding="2">
                                    <tr valign="middle" style="height: 27px; color: white; font-weight: bold; text-decoration: none;
                                        background-color: rgb(96, 149, 201);">
                                        <th>
                                            <span>Action</span>
                                        </th>
                                        <th>
                                            <span>#</span>
                                        </th>
                                        <th>
                                            <span>Part NBR</span>
                                        </th>
                                        <th>
                                            <span>Part Name</span>
                                        </th>
                                        <th>
                                            <span>VN Name</span>
                                        </th>
                                        <th>
                                            <span>Quantity</span>
                                        </th>
                                        <th>
                                            <span>Price</span>
                                        </th>
                                        <th>
                                            <span>VAT</span>
                                        </th>
                                        <th>
                                            <span>Discount</span>
                                        </th>
                                        <th>
                                            <span>P. Stock</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td colspan="9">
                                            <span>No Data</span>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr style="background: url(../../Images/tabbar.png); height: 30px">
                            <td colspan="4">
                                <asp:Label ID="Label2" runat="server" Text=" Labour" Font-Bold="True" ForeColor="White"></asp:Label>
                            </td>
                        </tr>
                    </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr>
                            <td class="FormLineItem">
                                <asp:Button ID="btn_LabourAdd" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                    Height="30px" Text="Add Labour Charge" Width="130px" OnClick="btn_LabourAdd_Click" />
                            </td>
                        </tr>
                    </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <asp:GridView ID="gvLabour" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px" CellSpacing="2" 
                            OnRowUpdating="UpdateItem" HeaderStyle-VerticalAlign="Middle" 
                            AllowPaging="True" OnRowDeleting="DeleteItem">
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                            <Columns>
                                <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="70px" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" TabIndex="-1" OnClick="lnkDelete_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblNo" runat="server" Text="" BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Position Code">
                                    <ItemStyle HorizontalAlign="Left" Width="100px" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtItemCode" runat="server" Text='<%# Bind("PositionCode") %>' OnTextChanged='TextBox_Change'
                                            OnKeyPress="return disablePopup(this, event);"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Quantity">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" Width="100px" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtQty" runat="server" Width="97%" Text='<%# Bind("Quantity") %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" Style="text-align: right"
                                            OnTextChanged="txtOrderQuantity_OnTextChanged" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Labour Charge">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtDiscount" Style="text-align: right" runat="server" Text='<%# Bind("LabourCharge") %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" OnTextChanged="txtUnitPrice_OnTextChanged" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                                Height="27px" VerticalAlign="Bottom" />
                            <EmptyDataTemplate>
                                <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                    cellspacing="2" cellpadding="2">
                                    <tr valign="middle" style="height: 27px; color: white; font-weight: bold; text-decoration: none;
                                        background-color: rgb(96, 149, 201);">
                                        <th>
                                            <span>Action</span>
                                        </th>
                                        <th>
                                            <span>#</span>
                                        </th>
                                        <th>
                                            <span>Position Code</span>
                                        </th>
                                        <th>
                                            <span>Quantity</span>
                                        </th>
                                        <th>
                                            <span>Labour Charge</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <span>No Data</span>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </table>

                    <table border="0" width="100%" style="background-color: #D1D4D8;">
                        <tr>
                            <td class="FormLineItem">
                                <asp:Button ID="Button3" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF" Height="30px"
                                    Text="New" Width="90px" />
                    
                                    <asp:Button ID="btn_Save" runat="server" BackColor="#1B7FC2" 
                                        ForeColor="#FFFFFF" Height="30px" Text="Save" Width="90px" />
                    
                                    <asp:Button ID="btn_Submit" runat="server" BackColor="#1B7FC2" 
                                        ForeColor="#FFFFFF" Height="30px" Text="Submit" Width="90px" />
                            </td>
                        </tr>
                    </table>

                   
                    
                </div>
                <table width="100%" border="0">
                    <tr>
                        <td>
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 220px;">
                                      
                                    </td>
                                    <td>
                                        <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
